package com.foruo.learn.designmode.state;

/**
 * 约定 状态的流转过程为 AState -> BState -> CState
 * @author GaoYuan
 * @date 2018/11/11 上午8:45
 */
public class TestMe {

    public static void main(String[] args){
        Context context = new Context();
        context.setState(new AState());

        context.run();
        System.out.println("当前状态：" + context.getState().toString());
        context.next();
        System.out.println("当前状态：" + context.getState().toString());

        context.run();
        System.out.println("当前状态：" + context.getState().toString());
        context.next();
        System.out.println("当前状态：" + context.getState().toString());

        context.run();
        System.out.println("当前状态：" + context.getState().toString());
        context.next();
        System.out.println("当前状态：" + context.getState().toString());

    }
}
